package cn.edu.zzuli.nothinglink.mapper;

import cn.edu.zzuli.nothinglink.entity.Classes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-08
 */
public interface ClassesMapper extends BaseMapper<Classes> {

    @Update("UPDATE classes c SET c.class_stu_number = c.class_stu_number + 1 WHERE c.class_id = #{classId}")
    boolean theClassNumberAddOne(@Param("classId") Integer classId);

    @Update("UPDATE classes c SET c.class_stu_number = c.class_stu_number - 1 WHERE c.class_id = #{classId}")
    boolean theClassNumberReduceOne(@Param("classId") Integer classId);

}
